package com.xcyy.zjdxmjk.zjdxmjk.service.Imp;

import com.xcyy.zjdxmjk.zjdxmjk.entity.House;
import com.xcyy.zjdxmjk.zjdxmjk.repository.HouseRepository;
import com.xcyy.zjdxmjk.zjdxmjk.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class HouseServiceImp implements HouseService {
    @Autowired
    private HouseRepository repository;

    @Override
    public House save(House house) {
        return repository.save(house);
    }

    @Override
    public List<House> findByTownCode(String townCode) {
        return repository.findByTownCode(townCode);
    }

    @Override
    public List<Object> countHouse() {
        return repository.countHouse();
    }
    @Override
    public List<Object> countQjdcAndBdccl(String code) {
        return repository.countQjdcAndBdccl(code);
    }

    @Override
    public List<Object> findByDept(List<String> codes) {
        return repository.findByDept(codes);
    }

    @Override
    public List<Object> findByDate(Date startDate, Date endDate) {
        return repository.findByDate(startDate, endDate);
    }

    @Override
    public List<Object> findByCodeAndStageAndType(String code, String stage, String type) {
        return repository.findByCodeAndStageAndType(code, stage, type);
    }

    @Override
    public House findByDateAndStageAndTypeAndTownCode(Date date,  Integer stage, Integer type, String code) {
        return repository.findByDateAndStageAndTypeAndTownCode(date, stage, type, code);
    }

    @Override
    public List<Object> findByDeptAndStage(String code) {
        return repository.findByDeptAndStage(code);
    }
}
